//
//  GestureImageView.m
//  Homework 2016-06-14
//
//  Created by Roach on 16/6/14.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "GestureImageView.h"

@implementation GestureImageView

- (instancetype)initWithImage:(UIImage *)image withFrame:(CGRect)frame {
    
    self = [super initWithImage:image];
    if (self) {
        self.frame = frame;
        self.userInteractionEnabled = YES;
        [self addTap];
    }
    return self;
    
}

- (void)addTap {
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)];
    
    [self addGestureRecognizer:tap];
    [tap release];
    
}
- (void)tapAction:(UITapGestureRecognizer *)tap {
    
    // 跳转设置
    [self.delegate jump];
}

@end
